const Mock = require('mockjs')
// import Mock from 'mockjs'
const boolList = require('./data/data')
const demoList = require('./data/demoList')


// 拦截ajax请求，配置mock的数据
Mock.mock(RegExp('/api/mock/booklist' + ".*"), 'get', (req) => {
  return boolList()
})

// 拦截ajax请求，配置mock的数据
Mock.mock(RegExp('/api/mock/school' + ".*"), 'post', (req) => {
  let params = JSON.parse(req.body)
  return demoList(params)
})
